﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Demo.Framework.Algorithm.Sort
{
    abstract class  AbstractSort<T> : ISort<T>
        where T: IComparable
    {
        protected void Swap(T[] list, int x, int y)
        {
            T temp = list[x];
            list[x] = list[y];
            list[y] = temp;
        }

        protected bool IsLess(T x, T y)
        {
            return x.CompareTo(y) == -1 ? true : false;
        }

        public abstract void Sort(T[] list);
        
    }
}
